package com.jj.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code;//状态码 1代表成功，0代表失败
    private String msg;//提示信息
    private Object data;// 数据
//    增删改
    public static Result success(){return new Result(1,"操作成功",null);}
//    查询
    public static Result success(Object data){return new Result(1,"操作成功",data);}
//    响应失败
    public static Result error(String msg){return new Result(0,msg,null);}

}
